﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NReader.Service.RAS;

namespace NReader.Service
{
    public class ArticleService
    {
        public static ArticleService _service;

        public static ArticleService Instance()
        {
            return _service ?? (_service = new ArticleService());
        }

        public async Task<ArticleInfo> GetArticle(int articleid)
        {
            var client = new RemoteArticleServiceClient();
            var article = await client.GetArticleAsync(articleid);
            return article;
        }

        public async Task<IList<ChapterInfo>> GetMaxChapterList(int articleid)
        {
            var client = new RemoteArticleServiceClient();
            var list = await client.GetMaxChapterListAsync(articleid);
            return list;
        }

        public async Task<IList<ChapterInfo>> GetBookReader(int articleid,string webflag)
        {
            var client = new RemoteArticleServiceClient();
            var list = await client.GetBookReaderAsync(articleid, webflag);
            return list;
        }
    }
}
